
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%
	//getting the user id which was passed in from the previous page
	Integer uid = Integer.parseInt(request.getParameter( "uid" ));
	//getting success to check if the transaction is successed or not
	Integer success = Integer.parseInt(request.getParameter( "success" ));
%>
<!-- javascript which will redirect the user from transaction.jsp page
     to one's own portfolio.jsp page -->
<script language="javascript" type='text/javascript'>
	function Go()
	{
		location.replace("portfolio.jsp?uid=<%=uid%>");
	}
</script>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>StarXChange</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>

<body class="twoColElsLtHdr">

<!-- container wraps the whole contents of the webpage -->
<div id="container">
<!-- header contains the logo of our application which links to index.jsp page -->
  <div id="header"><a href="index.jsp?uid=<%=uid%>"><img src="media/logo.jpg"/></a><!-- end #header --></div>
  <!-- sidebar contains the menu to navigate the application -->
  <div id="sidebar1">
   <ul class="sidenav">
				<li>
                	<a href="portfolio.jsp?uid=<%=uid%>" title="My Portfolio">My Portfolio
                    <span>See how rich I am</span>
                    </a>
                    
                </li>
			    <li>
                	<a href="stocklist.jsp?uid=<%=uid%>" title="Stocks">Stocks
                    <span>See the market flow</span>
                    </a>
                </li>
				<li>
                	<a href="rank.jsp?uid=<%=uid%>" title="Rank">Rank
                    <span>Who is the winner now</span>
                    </a>
                </li>
				<li>
                	<a href="howtoplay.jsp?uid=<%=uid%>" title="HowToPlay">How To Play
                    <span>Learn how to play the game</span>
                    </a>
                </li>
			</ul>
    
  <!-- end #sidebar1 --></div>
  <!-- mainContent will have the message saying if the transaction 
       has been made or not -->
  <div id="mainContent">
    <div id="uinf">
    			<% 	//when the transaction has been made
    				if (success == 0){ %>
    			<p>Congratulations.Your transaction was successful.</p>
    			<%	//when the user used fault quantity
    				} else if (success == 1){ %>
    			<p>Invalid quantity. Your transaction was not successful.</p>
    			<%	//when the user used invaild input
    				} else if (success == 2){%>
    			<p>Invalid input. Your transaction was not successful.</p>
    			<%} %>
    			<p>You will be redirected to your Portfolio page.</p>
    			<!-- setting the time for the user to stay in the transaction page -->
    			<script language="JavaScript">
    			setTimeout( "Go()", 1500 );
    			</script>
    		</div>

	<!-- end #mainContent --></div>
	<br class="clearfloat" />
	<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
   <div id="footer">
    <p>Ranks will be here</p>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
